﻿using System;

namespace GameSdk.MsgHelper
{
    public class SdkRouteHelper : SdkRouteBasicHelper
    {
        public byte[] Connector_EntryHandler_Entry(string username, string password, Action<object, int> callback = null)
        {
            var route = "connector.entryHandler.entry";
            var msg = new { username = username, password = password };
            var sendData = CommonHelper.SendMessage(NextReqId, route, msg);

            SetRouteAndAction(route, callback);

            return sendData;
        }

        public byte[] Connector_EntryHandler_Entry(string token, Action<object, int> callback = null)
        {
            var route = "connector.entryHandler.entry";
            var msg = new { token = token };
            var sendData = CommonHelper.SendMessage(NextReqId, route, msg);

            SetRouteAndAction(route, callback);

            return sendData;
        }


        public byte[] LOGIC_TEAMHANDLER_BATTLESTART(string mapid, Action<object, int> callback = null)
        {
            var route = "logic.teamHandler.battleStart";
            var msg = new { mapid = mapid };
            var sendData = CommonHelper.SendMessage(NextReqId, route, msg);

            SetRouteAndAction(route, callback);

            return sendData;
        }

        public byte[] LOGIC_PLAYERHANDLER_ACTIVECDKEY(string cdkey, Action<object, int> callback = null)
        {
            var route = "logic.playerHandler.activeCDKey";
            var msg = new { cdkey = cdkey };
            var sendData = CommonHelper.SendMessage(NextReqId, route, msg);

            SetRouteAndAction(route, callback);

            return sendData;
        }
    }
}